import { defineStore } from "pinia"

export const useMapData = defineStore("lineData", {
  state: () => {
    return {
      viewer: null,
      tileset: null,
    }
  },
  getters: {
    Viewer() {
      return this.viewer
    },
    Tile() {
      return this.tileset
    },
  },
  actions: {
    setViewer(viewer) {
      return new Promise((resolve, reject) => {
        this.viewer = viewer
        resolve(viewer)
      })
    },
    setTileset(tileset) {
      return new Promise((resolve, reject) => {
        this.tileset = tileset
        resolve(tileset)
      })
    },
  },
})
